convert API endpoints to functions